<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/cloudiary.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Cloudiary</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript" src="Js/jquery.js"></script>
<script type="text/javascript" src="Js/slider.js"></script>
<!-- InstanceEndEditable -->
<link href="CSS/css.css" rel="stylesheet" type="text/css" />
</head>
<?php
  include('userlock.php');
?>
<body>
<div id="container">
<div id="wrapper">

<div id="header">
<!-- InstanceBeginEditable name="header" -->
<div class="welcome">
<?php include('welcomeuser.php');?>
</div>
<!-- InstanceEndEditable -->

<img src="Assets/cloud diary low-01(trans).png" alt="CloudDiary" width="75" height="45" style="padding:5px 10px;" /> <br />
</div>

<div id="main">
	<!-- InstanceBeginEditable name="Main" -->
<ul class="dropdown">
<li><a href="Home.php" class="linkStraight">Home &nbsp; &nbsp;</a></li>
<li><a href="#" class="linkDown" id="classification">Classifications &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu1">
    <li> <a href="PublicClassification.php"> Public &nbsp; </a> </li>
    <li> <a href="FriendClassification.php"> Friend &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="friends">Friends &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu2">
    <li> <a href="Friends.php"> Search Friends &nbsp; </a> </li>
    <li> <a href="CurrentFriends.php"> Current Friends &nbsp; </a> </li>
    <li> <a href="Send.php"> Sending Request &nbsp; </a> </li>
    <li> <a href="Receive.php"> Pending Request &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="posts">Posts &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu3">
    <li> <a href="NewPost.php"> New Post &nbsp; </a> </li>
    <li> <a href="ViewPosts.php">  View All Posts &nbsp; </a> </li>
    </ul>
</li>
<li><a href="Privacy.php" class="linkStraight">Privacy Settings &nbsp; &nbsp;</a></li>
</ul>

<div id="content">
    <p> PENDING REQUEST </p>
<?php

  $sql_1="SELECT friend_email FROM receive_request WHERE user_email= '$login_session' ";
  $q1=mysql_query($sql_1);
  
  if(!empty($_GET['receive']))
  {
    echo"Friend Request Accepted";
  }
  
  if(!empty($_GET['del']))
  {
    echo"Friend Request Rejected";
  }
    
  while($data_fetch=mysql_fetch_array($q1))
  {

    $friend_email=$data_fetch['friend_email'];
    $q2=mysql_query("SELECT user_name, user_email, user_gender, user_status, user_dob, user_country FROM user WHERE user_email='$friend_email'");
    $data_fetch_q2=mysql_fetch_array($q2);
?>    
    
        <table border="0" width="100%" style=" margin-bottom:8px">
    <tr>
        <td width="10" rowspan="3">&nbsp;  </td>
        <td colspan="3">&nbsp;  </td> 
        <td width="10" rowspan="3">&nbsp;  </td>
    </tr>
    <tr>
      <td width="150px"> <img src='display_photo.php?id=<?php echo $friend_email; ?>' width="150px" height="170px" alt="userPicture" style="border:solid 1px #69F; padding:2px;" /> </td>
      <td height="100px" align="right">
	  
	  <table border="0" width="100%">		
		<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Name </span> : &nbsp; <?php echo $data_fetch_q2['user_name']; ?> </label> </td> </tr>
		<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Gender </span> : &nbsp; <?php echo $data_fetch_q2['user_gender']; ?> </label> </td> </tr>
		<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Date of Birth </span> : &nbsp; <?php echo $data_fetch_q2['user_dob']; ?> </label> </td> </tr>
		<tr> <td height="10px" style="padding-left:10px" id="particular"> <label> <span> Country </span> : &nbsp; <?php echo $data_fetch_q2['user_country']; ?> </label> </td> </tr>
		</table> </td>
		
      <td width="200px" align="center"> 
        <p> 
          <form name="accept"  action="Accept.php" method="POST">
            <input type="hidden" name="acceptID" value="<?php echo $friend_email; ?>"/>
            <input type="image" src="Assets/buttonAccept.png" value="Accept" /> 
          </form>
        </p>
        
        <p> 
          <form name="reject"  action="FriendSQL.php" method="POST">
            <input type="hidden" name="query1" value="<?php echo "DELETE FROM receive_request WHERE user_email='$login_session' AND friend_email='$friend_email'"; ?>" /> 
			  <input type="hidden" name="query2" value="<?php echo "DELETE FROM send_request WHERE user_email='$friend_email' AND friend_email='$login_session'"; ?>" />
			  <input type="hidden" name="location" value="<?php echo "Receive.php?add=1"; ?>"/>
            <input type="image" src="Assets/buttonReject.png" value="Reject" /> 
          </form>
        </p> 
      </td>
    </tr>
    <tr>
      <td colspan="3"  style="border-bottom:solid 1px #69F;">&nbsp;  </td>
    </tr>
    </table>
<?php
    echo"<br />";
  }

?>
</div>
    <!-- InstanceEndEditable -->
</div>

</div>
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 CloudDiary </p>
</div>
</body>
<!-- InstanceEnd --></html>
